package com.hue.gulimail.gulimailproduct.feign;

import com.hue.common.to.SkuReductionTo;
import com.hue.common.to.SpuBoundsTo;
import com.hue.common.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient("gulimail-coupon")
public interface CouponFeignService {
    /**
     * 远程过程调用的步骤：
     *  1.将请求@RequestBody标注的对象转为json数据
     *  2.给目标服务发送请求，在请求体中带上json数据
     *  3.目标服务接收到json数据后将转为对象封装
     * 所以在远程过程调用中，双方的请求体json模型一样即可,不一定要相同的对象
     * @param spuBoundsTo
     * @return
     */
    @PostMapping("/gulimailcoupon/spubounds/saveSpuBounds")
    public R saveSpuBounds(@RequestBody SpuBoundsTo spuBoundsTo);

    @PostMapping("/gulimailcoupon/skufullreduction/saveReductionInfo")
    public R saveReductionInfo(@RequestBody SkuReductionTo skuReductionTo);
}
